home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / Q-R / QDPat.cpt / InitTheMenus.Pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-10-07  |  1.7 KB  |  51 lines  |  [TEXT/PJMM]

  1. unit  InitTheMenus;
  2.  
  3. {File name:  InitTheMenus.Pas}
  4. {Function: Pull in menu lists from a resource file.}
  5. {          This procedure is called once at program start.}
  6. {          AppleMenu is the handle to the Apple menu, it is also}
  7. {          used in the procedure that handles menu events.}
  8. {History: 10/6/89 Original by Prototyper.   }
  9. {                       }
  10. interface
  11.  
  12.     procedure Init_My_Menus;            {Initialize the menus}
  13.  
  14.     var
  15.         AppleMenu:MenuHandle;           {Menu handle}
  16.         M_File:MenuHandle;              {Menu handle}
  17.         M_Edit:MenuHandle;              {Menu handle}
  18.         M_Shapes:MenuHandle;            {Menu handle}
  19.  
  20. implementation
  21.  
  22.     procedure Init_My_Menus;            {Initialize the menus}
  23.     const
  24.         Menu1 = 1001;                   {Menu resource ID}
  25.         Menu2 = 1002;                   {Menu resource ID}
  26.         Menu3 = 1003;                   {Menu resource ID}
  27.         Menu4 = 1004;                   {Menu resource ID}
  28.  
  29.     begin                               {Start of Init_My_Menus}
  30.         ClearMenuBar;                   {Clear any old menu bars}
  31.  
  32.         { This menu is the APPLE menu, used for About and desk accessories.}
  33.         AppleMenu := GetMenu(Menu1);{Get the menu from the resource file}
  34.         InsertMenu (AppleMenu,0);       {Insert this menu into the menu bar}
  35.         AddResMenu(AppleMenu,'DRVR');{Add in DAs}
  36.  
  37.         M_File := GetMenu(Menu2);       {Get the menu from the resource file}
  38.         InsertMenu (M_File,0);          {Insert this menu into the menu bar}
  39.  
  40.         M_Edit := GetMenu(Menu3);       {Get the menu from the resource file}
  41.         InsertMenu (M_Edit,0);          {Insert this menu into the menu bar}
  42.  
  43.         M_Shapes := GetMenu(Menu4);{Get the menu from the resource file}
  44.         InsertMenu (M_Shapes,0);        {Insert this menu into the menu bar}
  45.  
  46.         DrawMenuBar;                    {Draw the menu bar}
  47.  
  48. end;                                    {End of procedure Init_My_Menus}
  49.  
  50. end.                                    {End of this unit}
  51.